
let skin_btn = document.querySelector('.skin-btn');
let skin = document.querySelector('.skin');

let flag = 0;
skin_btn.addEventListener('click',function(){
    if (flag ==  0) {
        skin.style.visibility = 'visible';
        flag = 1; 
    }
    else if (flag == 1) {
        skin.style.visibility = 'hidden';
        flag = 0;
    }
})


let imgs = document.querySelectorAll('.skin li img');
console.log(imgs[0]);
for (let i = 0; i < imgs.length; i++) {
    imgs[i].onclick = function(){
        console.log(imgs[i]);
        document.querySelector('.container').style.background = "url('"+imgs[i].src+"')";
        return false;
    }
    
}